package com.itheima.bigevent.pojo;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

/**
 * @TableName user
 */
@Data
public class User implements Serializable {
    @NotNull
    private Integer id;

    private String username;

    // 当把当前对象转化为Json字符串以后, 会忽略password这个属性, 最终json字符串就没有password这个属性
    @JsonIgnore
    private String password;

    @NotEmpty
    @Pattern(regexp = "^\\S{5,16}$")
    private String nickname;

    @NotNull
    @Email
    private String email;

    private String userPic;

    private Date createTime;

    private Date updateTime;

    private static final long serialVersionUID = 1L;
}